import { defineStore } from "pinia";
import store from "@/store";

const useTestStore = defineStore("test", {
  state: () => ({
    firstName: "Kou",
    lastName: "Chuanhua",
  }),
  getters: {
    fullName(): any {
      return this.firstName + " " + this.lastName;
    },
  },
  actions: {
    change() {
      this.lastName = this.lastName + "6";
    },
  },
});

export default function useTestStoreHook() {
  return useTestStore(store);
}
